const common = {
    toast:function(status, msg){
        let div = document.createElement('div');
        div.className = 'toast'
        div.innerHTML = `
            <div class="icon">
            ${status==0?'!':'√'}
            </div>
            <div class="msg">
            ${msg}
            </div>
        `
        document.body.appendChild(div);

        setTimeout(function(){
            div.remove()
        },2000)
    },
    footer:function(page ='jogging'){
        let footer = document.createElement('footer');
        footer.className = 'dpflex';
        footer.innerHTML = `
        <a href ="./jogging.html">
        <div class="on c ${page=='jogging'?'active':''}">
            <i class="iconfont icon-fangzi"></i>
            <p>首页</p>
        </div>
        </a>
        <a href ="./sports.html">
        <div class=" ${page=='sports'?'active':''}">
            <i class="iconfont icon-heart-rate"></i>
            <p>运动</p>
        </div>
        </a>
        <a href ="./users.html">
        <div class="${page=='users'?'active':''}">
            <i class="iconfont icon-31wode"></i>
            <p>我的</p>
        </div>
        </a>
        `;
        document.body.appendChild(footer);
    }    
}
window.common = common